$(function () {
    $('.input_sub').on('click', function (e) {
      e.preventDefault()
      let username = $('.input_txt').val().trim()
      let password = $('.input_pass').val().trim()
      if (username == '' || password == '') {
        alert('输入的内容不能为空');
        return
      }
      $.ajax({
        url: BigNew.user_login,
        type: 'post',
        data: {
          username,
          password,
        },
        success(getdata) {
          // console.log(getdata);
          if(getdata.code==200){
            alert('登录成功');
            window.localStorage.setItem('token',getdata.token)
            window.location.href ='./index.html'
          }
        }

      })
    })

  })